package com.zzyl;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

import javax.annotation.Resource;

@SpringBootTest
public class RedisTest1 {
    @Resource
    private RedisTemplate redisTemplate;
    @Test
    public void test() {
        User user1 = new User("zzyl1", 10);
        User user2 = new User("zzyL2", 20);
        User user3 = new User("zzyl3", 30);
        redisTemplate.opsForHash().put(user1,user2,user3);
        Object o = redisTemplate.opsForHash().get(user1, user2);
        System.out.println(o);
    }
}
